import cv2
import os
from binocular_module_calibration.finetune_box import GetAnnotBoxLoc, display, change_rate_box

def gray_match(image1, image2, boxes_dict):
    '''

    :param image1:
    :param image2:
    :param boxes:
    :return:
    '''
    out_boxes = {}
    print('gray match')
    for key in boxes_dict:
        temp_boxes = boxes_dict[key]
        for box in temp_boxes:

            cv2.matchTemplate(image2, )
    return out_boxes


def surf_match(image1, image2, boxes):
    '''

    :param image1:
    :param image2:
    :param boxes:
    :return:
    '''
    boxes = []
    print('gray match')
    return boxes


def orb_match(image1, image2, boxes):
    '''

    :param image1:
    :param image2:
    :param boxes:
    :return:
    '''
    boxes = []
    print('gray match')
    return boxes


if __name__ == '__main__':
    rgb_image_path = '/data/ICE/RGBCollection/rgb_images/2021_05_19_09_08_46_1621415326844.jpg'
    gray_image_path = '/data/ICE/RGBCollection/cam1/images/cam12021_05_19_09_08_46_1621415326844.jpg'
    xml_path = '/data/ICE/RGBCollection/cam1/xml/cam12021_05_19_09_08_46_1621415326844.xml'

    gray_image = cv2.imread(gray_image_path)
    rgb_image = cv2.imread(rgb_image_path)

    ObjBndBoxSet = GetAnnotBoxLoc(xml_path)

    boxes = []
    display(ObjBndBoxSet, gray_image, 'feature_test/display_base.jpg')
